# rm -rf build install log

start_time=$(date +%s)
unset CMAKE_PREFIX_PATH
source ~/agst_slam_ros2/install/setup.bash
source ~/agst_robot_ros2/install/local_setup.bash
# echo $CMAKE_PREFIX_PATH  # 检查是否包含两个工作空间的路径

colcon build --symlink-install --event-handlers console_direct+ --packages-select trobot_startup
colcon build --symlink-install --event-handlers console_direct+ --packages-select hardware_controller

# 编译全部功能包
colcon build \
  --symlink-install \
  --cmake-args -DCMAKE_BUILD_TYPE=Release \
  --allow-overriding serial teleop_twist_keyboard \
    imu_complementary_filter imu_filter_madgwick nav2_costmap_2d rviz_imu_plugin \
  --packages-ignore CoveragePlanner perception_ros planner_ros motion_control_ros fdilink_ahrs